package org.example.function_interface.Supplier;

import java.util.Random;
import java.util.function.Supplier;

public class SupplierWithLambda {
    public static void main(String[] args) {
        Supplier<String> s1 = () -> "Hello World!";
        System.out.println(s1.get());
        Random random = new Random();
        Supplier<Integer> s2 = () -> random.nextInt(10);
        System.out.println(s2.get());
    }
}
// 输出
// Hello World! 